package com.migration.model.newdb;

import jakarta.persistence.*;
import lombok.Data;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * 租户用户表 实体类
 * 表名：sys_user
 * 自动生成的实体类
 */
@Data
@Entity
@Table(name = "sys_user")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * 主键，自增长
     * 主键
     */
    @Id
    @Column(name = "id", nullable = false)
    private Long id;
    
    /**
     * 租户ID
     */
    @Column(name = "tenant_id", nullable = false)
    private Long tenantId;
    
    /**
     * 是否是租户管理员0：否，1：是
     * 默认值: 0
     */
    @Column(name = "tenant_admin", nullable = false)
    private Boolean tenantAdmin;
    
    /**
     * 用户名
     */
    @Column(name = "user_name", nullable = false, length = 100)
    private String userName;
    
    /**
     * 密码盐
     */
    @Column(name = "password_salt", length = 100)
    private String passwordSalt;
    
    /**
     * 密码
     */
    @Column(name = "pass_word", nullable = false, length = 255)
    private String passWord;
    
    /**
     * 显示名称
     */
    @Column(name = "nick_name", nullable = false, length = 100)
    private String nickName;
    
    /**
     * 邮箱
     */
    @Column(name = "user_email", length = 100)
    private String userEmail;
    
    /**
     * 电话
     */
    @Column(name = "user_phone", length = 20)
    private String userPhone;
    
    /**
     * 工号
     */
    @Column(name = "work_no", length = 100)
    private String workNo;
    
    /**
     * '性别（MALE：男，FEMALE：女，OTHER：未知）'
     * 默认值: UNKNOWN
     */
    @Column(name = "user_gender", length = 7)
    private String userGender;
    
    /**
     * 用户头像
     */
    @Column(name = "user_avatar")
    private byte[] userAvatar;
    
    /**
     * 0：锁定，1：正常
     * 默认值: 1
     */
    @Column(name = "locked_status")
    private Boolean lockedStatus;
    
    /**
     * 锁定之后解锁时间
     */
    @Column(name = "unlock_time")
    private java.time.LocalDateTime unlockTime;
    
    /**
     * 0：冻结，1：正常
     * 默认值: 1
     */
    @Column(name = "enable_status")
    private Boolean enableStatus;
    
    /**
     * 创建时间
     */
    @Column(name = "create_time", length = 20)
    private String createTime;
    
    /**
     * 更新时间
     */
    @Column(name = "update_time", length = 20)
    private String updateTime;
    
    /**
     * 创建人
     */
    @Column(name = "create_by")
    private Long createBy;
    
    /**
     * 更新人
     */
    @Column(name = "update_by")
    private Long updateBy;
    
    /**
     * 逻辑删除标志（0：正常，1：删除）
     * 默认值: 0
     */
    @Column(name = "is_del")
    private Boolean isDel;
    
    @Override
    public String toString() {
        return "SysUser{" +
            "id=" + id +
            ", tenantId=" + tenantId +
            ", tenantAdmin=" + tenantAdmin +
            ", userName=" + userName +
            ", passwordSalt=" + passwordSalt +
            ", passWord=" + passWord +
            ", nickName=" + nickName +
            ", userEmail=" + userEmail +
            ", userPhone=" + userPhone +
            ", workNo=" + workNo +
            ", userGender=" + userGender +
            ", userAvatar=" + userAvatar +
            ", lockedStatus=" + lockedStatus +
            ", unlockTime=" + unlockTime +
            ", enableStatus=" + enableStatus +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", createBy=" + createBy +
            ", updateBy=" + updateBy +
            ", isDel=" + isDel +
        '}';
    }
} 